<?xml version='1.0' encoding='UTF-8' ?>
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:p="http://primefaces.prime.com.tr/ui">
    <f:view contentType="text/html">
        <h:head>
            <title>Facelet Title</title>
        </h:head>

        <h:body>   


            <ui:composition template="template.xhtml">
                <ui:define name="title">
                    <h:outputText value="Radiocabs.in"></h:outputText>
                </ui:define>

                <ui:define name="content_left">                
                    <ui:include src="index_left.xhtml" />   

                    <h:form>  
                        <p:messages showDetail="true" autoUpdate="true"/>
                        <p:panel header="AutoComplete" toggleable="true">  
                            <h:panelGrid columns="2" cellpadding="5">  

                                <h:outputLabel value="Simple :" for="acSimple" />  
                                <p:autoComplete id="acSimple" value="#{accountManagedBean.txt1}"   
                                                completeMethod="#{accountManagedBean.complete}">
                                    <f:validateLength minimum="3" maximum="12"/>
                                </p:autoComplete>


                                <h:outputLabel value="Min Length (3) :" for="acMinLength" />  
                                <p:autoComplete id="acMinLength" minQueryLength="3"   
                                                value="#{accountManagedBean.txt2}"   
                                                completeMethod="#{accountManagedBean.complete(a)}"/>  

                                <h:outputLabel value="Delay(1000) :" for="acDelay" />  
                                <p:autoComplete id="acDelay" queryDelay="1000"   
                                                value="#{accountManagedBean.txt3}"  
                                                completeMethod="#{accountManagedBean.complete}"/>  

                                <h:outputLabel value="Max Results(5) :" for="acMaxResults" />  
                                <p:autoComplete id="acMaxResults" maxResults="5"   
                                                value="#{accountManagedBean.txt4}"   
                                                completeMethod="#{accountManagedBean.complete}"/>  

                                <h:outputLabel value="Force Selection :" for="acForce" />  
                                <p:autoComplete id="acForce" forceSelection="true"   
                                                value="#{accountManagedBean.txt5}"   
                                                completeMethod="#{accountManagedBean.complete}"/>  

                                <h:outputLabel value="DropDown :" for="dd" />  
                                <p:autoComplete id="dd" value="#{accountManagedBean.txt6}"   
                                                completeMethod="#{accountManagedBean.complete}" />  

                            </h:panelGrid>  
                        </p:panel>  

                        <p:commandButton value="Submit" update="display" oncomplete="handleComplete()" />  


                        <script type="text/javascript">  
                            function handleComplete() {  
                                alert("Hello !" + value);  
                            }  
                        </script>  

                        <p:dataTable var="car" value="#{accountManagedBean.allAccount}" paginator="true" rows="10"  
                                     selection="#{accountManagedBean.selectedAccount}" selectionMode="single">  

                            <f:facet name="header">  
                                List of Cars  
                            </f:facet>  

                            <p:column sortBy="#{car.id}" filterBy="#{car.id}">  
                                <f:facet name="header">  
                                    <h:outputText value="ID" />  
                                </f:facet>  
                                <h:outputText value="#{car.id}" />  
                            </p:column>  

                            <p:column sortBy="#{car.userName}" filterBy="#{car.userName}">  
                                <f:facet name="header">  
                                    <h:outputText value="Username" />  
                                </f:facet>  
                                <h:outputText value="#{car.userName}" />  
                            </p:column>  

                            <p:column sortBy="#{car.password}" filterBy="#{car.password}">  
                                <f:facet name="header">  
                                    <h:outputText value="Password" />  
                                </f:facet>  
                                <h:outputText value="#{car.password}" />  
                            </p:column>  

                        </p:dataTable>  

                    </h:form>  

                </ui:define>
            </ui:composition>
        </h:body>
    </f:view>
</html>

